package cn.com.utt.unms.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.com.utt.unms.mapper.AuthSmsMapper;
import cn.com.utt.unms.mapper.SmsBuyMapper;
import cn.com.utt.unms.pojo.Product;
import cn.com.utt.unms.service.SmsBuyService;

@Service("smsBuyService")
public class SmsBuyServiceImpl implements SmsBuyService {

	@Autowired
	private SmsBuyMapper smsBuyMapper;
	
	@Autowired
	private AuthSmsMapper authSmsMapper;

	@Override
	@Transactional
	public Product getProduct(long id) {
		return smsBuyMapper.queryProductById(id);
	}

	@Override
	@Transactional
	public long countAuthSmsByUserId(long userId) {
		return authSmsMapper.countAuthSmsByUserId(userId);
	}

}
